import android.os.Build
import android.os.Bundle
import android.support.annotation.RequiresApi
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentPagerAdapter
import android.support.v4.view.ViewPager
import android.support.v7.app.AppCompatActivity
import android.view.View
import app.kotlin_1.R
import org.jetbrains.anko.*
import org.jetbrains.anko.sdk25.coroutines.onClick

/**
 * Created by 刘智强 on 2017/9/19.
 */

class TestKotlinActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        ActivityUi().setContentView(this)

    }
    class  ActivityUi:AnkoComponent<TestKotlinActivity>{
        override fun createView(ui: AnkoContext<TestKotlinActivity>)=
                ui.apply {
                    verticalLayout() {
                        button("OK"){
                            onClick { toast("确定") }
                        }

                    }


                }.view

    }

}
